package cn.heyige.backend.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;

import javax.validation.constraints.NotNull;
import java.time.LocalDateTime;

@Data
@Schema(description = "会员相关数据传输对象")
public class MemberDto {
    
    @Schema(description = "创建会员订单请求")
    @Setter
    @Getter
    public static class CreateOrderRequest {
        @Schema(description = "会员等级ID", example = "1", requiredMode = Schema.RequiredMode.REQUIRED)
        @NotNull(message = "会员等级ID不能为空")
        private Integer levelId;
    }
    
    @Setter
    @Getter
    @Schema(description = "支付请求")
    public static class PayRequest {
        @Schema(description = "支付方式", example = "alipay", requiredMode = Schema.RequiredMode.REQUIRED)
        @NotNull(message = "支付方式不能为空")
        private String paymentMethod;
        
        @Schema(description = "支付单号", example = "2024010112345678")
        private String paymentNo;

    }
    
    @Setter
    @Getter
    @Schema(description = "订单响应")
    public static class OrderResponse {
        @Schema(description = "订单ID", example = "1")
        private Integer id;
        
        @Schema(description = "用户ID", example = "1")
        private Integer userId;
        
        @Schema(description = "订单号", example = "ORDER2024010112345678")
        private String orderNo;
        
        @Schema(description = "订单状态", example = "PAID")
        private String status;
        
        @Schema(description = "订单金额", example = "99.99")
        private Double amount;
        
        @Schema(description = "会员天数", example = "30")
        private Integer durationDays;
        
        @Schema(description = "会员等级ID", example = "1")
        private Integer memberLevelId;
        
        @Schema(description = "会员等级名称", example = "VIP")
        private String memberLevelName;
        
        @Schema(description = "会员等级显示名称", example = "黄金会员")
        private String memberLevelDisplayName;
        
        @Schema(description = "开始时间", example = "2024-01-01T00:00:00")
        private LocalDateTime startTime;
        
        @Schema(description = "结束时间", example = "2024-01-31T23:59:59")
        private LocalDateTime endTime;
        
        @Schema(description = "支付时间", example = "2024-01-01T12:00:00")
        private LocalDateTime paidTime;
        
        @Schema(description = "创建时间", example = "2024-01-01T10:00:00")
        private LocalDateTime createdAt;

    }
    
    @Setter
    @Getter
    @Schema(description = "VIP状态响应")
    public static class VipStatusResponse {
        @Schema(description = "用户ID", example = "1")
        private Integer userId;
        
        @Schema(description = "是否是VIP", example = "true")
        private Boolean isVip;
        
        @Schema(description = "VIP到期时间", example = "2024-01-31T23:59:59")
        private LocalDateTime vipExpireTime;
        
        @Schema(description = "剩余天数", example = "15")
        private Integer remainingDays;

    }
}